/*
 * cross.h
 *
 *  Created on: 2023骞�3鏈�20鏃�
 *      Author: 0
 */

#ifndef CODE_CROSS_H_
#define CODE_CROSS_H_

#include "zf_common_headfile.h"

enum cross_type_e {
    CROSS_NONE = 0,     // 没进十字路口
    CROSS_BEGIN,        // 前方十字路口
    CROSS_IN,           // 进入十字路口
    CROSS_NUM,          // 十字状态个数
};

extern enum cross_type_e cross_type;

extern const char *cross_type_name[CROSS_NUM];

extern bool far_Lpt0_found_left, far_Lpt1_found_right;
extern int far_Lpt0_rpts0s_id_left, far_Lpt1_rpts1s_id_right;

extern int far_ipts0[FAR_POINTS_MAX_LEN][2];
extern int far_ipts1[FAR_POINTS_MAX_LEN][2];
extern int far_ipts0_num, far_ipts1_num;

extern float far_rpts0[FAR_POINTS_MAX_LEN][2];
extern float far_rpts1[FAR_POINTS_MAX_LEN][2];
extern int far_rpts0_num, far_rpts1_num;

extern float far_rpts0b[FAR_POINTS_MAX_LEN][2];
extern float far_rpts1b[FAR_POINTS_MAX_LEN][2];
extern int far_rpts0b_num, far_rpts1b_num;

extern float far_rpts0s[FAR_POINTS_MAX_LEN][2];
extern float far_rpts1s[FAR_POINTS_MAX_LEN][2];
extern int far_rpts0s_num, far_rpts1s_num;

extern float far_rpts0a[FAR_POINTS_MAX_LEN];
extern float far_rpts1a[FAR_POINTS_MAX_LEN];
extern int far_rpts0a_num, far_rpts1a_num;

extern float far_rpts0an[FAR_POINTS_MAX_LEN];
extern float far_rpts1an[FAR_POINTS_MAX_LEN];
extern int far_rpts0an_num, far_rpts1an_num;

extern float far_rptsc0[FAR_POINTS_MAX_LEN][2];
extern float far_rptsc1[FAR_POINTS_MAX_LEN][2];
extern int far_rptsc0_num, far_rptsc1_num;

extern bool black_road;
void check_cross(void);

void run_cross(void);

void cross_farline(void);

void cheak_black_roaad(void);

#endif /* CODE_CROSS_H_ */

